<?php
	define('BASE', 		str_ireplace("index.php", "", $_SERVER["SCRIPT_NAME"]));
	define('PUBLICO',  	BASE."public/");
	define('IMAGES',  	PUBLICO."images/");
	define('CSS',  		PUBLICO."css/");
	define('JS',  		PUBLICO."js/");

	define('APP',  		"application/");
	define('LIBRARY',  	"library/");
	define('MODULES',  	APP."modules/");
	define('MODEL',  	"models/");
	define('LAYOUTS',  	APP."layouts/");

	define('UPLOADS', 	PUBLICO.'uploads/');
	define('THEMES', 	PUBLICO."themes/");
	
	define("HTML_COMPACTO", true);

	require_once "library/popphp/POP.php";
	require_once 'library/core/loader.php';

	/************************************************************************
							 Database connection
	************************************************************************/
	$GLOBALS['DB_TYPE']      = 'sqlite';
	$GLOBALS['DB_SERVER']    = 'localhost';
	$GLOBALS['DB_NAME']      = $_SERVER['DOCUMENT_ROOT'].'/cache/correios.db';
	$GLOBALS['DB_USER']      = 'root';
	$GLOBALS['DB_PASSWD']    = '';

	//you must create a connection named 'pop_db' to be the default connection
	try
	{
		POPDB::addConnection('pop_db', $GLOBALS['DB_TYPE'], $GLOBALS['DB_SERVER'], $GLOBALS['DB_NAME'], $GLOBALS['DB_USER'], $GLOBALS['DB_PASSWD']);
	}
	catch (PDOException $e)
	{
        echo 'There was an error trying to connect to the database: ' . $e->getMessage();
    }